package com.chinabsc.zzw.nativewebrtc;

import android.app.Service;
import android.content.Intent;
import android.os.Binder;
import android.os.IBinder;
import android.util.Log;

import java.util.Random;

public class RtcService extends Service {
    private final IBinder mBinder = new LocalBinder();
    private final Random mGenerator = new Random();
    public class LocalBinder extends Binder {
        RtcService getService() {
            return RtcService.this;
        }
    }

    @Override
    public IBinder onBind(Intent intent) {
        Log.i("zzw","onBind");
        return mBinder;
    }
    @Override
    public boolean onUnbind(Intent intent) {
        Log.i("zzw","onUnbind");
        return super.onUnbind(intent);
    }

    @Override
    public void onRebind(Intent intent) {
        Log.i("zzw","onRebind");
        super.onRebind(intent);
    }

    @Override
    public void onDestroy() {
        Log.i("zzw","onDestroy");
        super.onDestroy();
    }

    @Override
    public void onStart(Intent intent, int startId) {
        Log.i("zzw","onStart"+startId);
        super.onStart(intent, startId);
    }

    @Override
    public int onStartCommand(Intent intent, int flags, int startId) {
        Log.i("zzw","onStartCommand-flags"+flags+"-startId-"+startId);
        return super.onStartCommand(intent, flags, startId);
    }

    public int getRandomNumber() {
        return mGenerator.nextInt(100);
    }


}
